﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using DOAN.DO;
using DOAN.BL;

namespace DOAN
{
    public partial class home : System.Web.UI.Page
    {
        public void Page_Load(object sender, EventArgs e)
        {
            if (Session["Tendangnhap"] != null)
            {

                MasterPage mt = this.Master as MasterPage;
                LinkButton lb = mt.FindControl("LinkButton1") as LinkButton;
                lb.Visible = false;
                Label bl = mt.FindControl("lblDnthanhcong") as Label;
                bl.Visible = true;
                Label blten = mt.FindControl("lbtendn") as Label;
                blten.Visible = true;
                blten.Text = Session["Tendangnhap"].ToString();
                LinkButton lbDangky = mt.FindControl("lbDangky") as LinkButton;
                //lbDangky.Visible = false;
                LinkButton lbthoat = mt.FindControl("lbThoat") as LinkButton;
                lbthoat.Visible = true;
                LoadData();
            }
            //string sql = "Select *,Left(Tieude,50) as 'TomTat' from Thongbao";
            //rptNoidungkhac.DataSource = Database.GetData(sql);
            //rptNoidungkhac.DataBind();
        }
        public void LoadData()
        {
            DataTable dt = new ThongbaoBL().SelectAll();
            if (dt.Rows.Count > 0)
            {
                //rpt.DataSource = dt;
                //rpt.DataBind();
                rptNoidungkhac.DataSource = dt;
                rptNoidungkhac.DataBind();
            }
        }
    }
}
